/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

相关接口
API related to order

OpenAPI spec version: v2
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKOrder/OrderApiModel.h>


@implementation OrderQueryOrderRequest
-(id) initWithRegion:(NSString *)regionId
includeDetail:(NSNumber*)includeDetail
orderNumber:(NSString*)orderNumber { 
    self.regionId = regionId;
    self.includeDetail = includeDetail;
    self.orderNumber = orderNumber;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
includeDetail:(NSNumber*)includeDetail
orderNumber:(NSString*)orderNumber { 
    self.regionId = regionId;
    self.version = version;
    self.includeDetail = includeDetail;
    self.orderNumber = orderNumber;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self includeDetail])
    {
        [result setValue:[self includeDetail] forKey:@"includeDetail"];
    }
    if([self orderNumber])
    {
        [result setValue:[self orderNumber] forKey:@"orderNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.includeDetail = [dictionary objectForKey:@"includeDetail"];
    self.orderNumber = [dictionary objectForKey:@"orderNumber"];
    return self;
} 

@end
@implementation OrderPayOrderResult
-(id) initWithOrderNumber:(NSString*) orderNumber
        autoPay:(NSNumber*)autoPay { 
    self.orderNumber = orderNumber;               
    self.autoPay = autoPay;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self orderNumber])
    {
        [result setValue:[self orderNumber] forKey:@"orderNumber"];
    }
    if([self autoPay])
    {
        [result setValue:[self autoPay] forKey:@"autoPay"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.orderNumber = [dictionary objectForKey:@"orderNumber"];
    self.autoPay = [dictionary objectForKey:@"autoPay"];
    return self;
} 

@end
@implementation OrderPayOrderRequest
-(id) initWithRegion:(NSString *)regionId
autoPay:(NSNumber*)autoPay
orderNumber:(NSString*)orderNumber { 
    self.regionId = regionId;
    self.autoPay = autoPay;
    self.orderNumber = orderNumber;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
autoPay:(NSNumber*)autoPay
orderNumber:(NSString*)orderNumber { 
    self.regionId = regionId;
    self.version = version;
    self.autoPay = autoPay;
    self.orderNumber = orderNumber;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self autoPay])
    {
        [result setValue:[self autoPay] forKey:@"autoPay"];
    }
    if([self orderNumber])
    {
        [result setValue:[self orderNumber] forKey:@"orderNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.autoPay = [dictionary objectForKey:@"autoPay"];
    self.orderNumber = [dictionary objectForKey:@"orderNumber"];
    return self;
} 

@end
@implementation OrderQueryOrdersRequest
-(id) initWithRegion:(NSString *)regionId
queryVo:(ListOrderRequest*)queryVo { 
    self.regionId = regionId;
    self.queryVo = queryVo;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
queryVo:(ListOrderRequest*)queryVo { 
    self.regionId = regionId;
    self.version = version;
    self.queryVo = queryVo;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self queryVo])
    {
        [result setValue:[[self queryVo] dictionary]forKey:@"queryVo"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.queryVo = [[ListOrderRequest alloc]initWithDic:[dictionary objectForKey:@"queryVo"]];
    return self;
} 

@end
@implementation OrderQueryOrderResult
-(id) initWithData:(OrderDetailResponseObject*) data { 
    self.data = data;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self data])
    {
        [result setValue:[[self data] dictionary]forKey:@"data"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.data = [[OrderDetailResponseObject alloc]initWithDic:[dictionary objectForKey:@"data"]];
    return self;
} 

@end
  
@implementation OrderQueryOrderResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
OrderQueryOrderResult* result = [[OrderQueryOrderResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(OrderQueryOrderResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation OrderQueryOrdersResult
-(id) initWithResultList:(NSArray<OrderResponseObject*>*) resultList
        totalCount:(NSNumber*)totalCount
        totalPage:(NSNumber*)totalPage { 
    self.resultList = resultList;               
    self.totalCount = totalCount;               
    self.totalPage = totalPage;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resultList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self resultList] count]; i++) {
            OrderResponseObject* item = [[self resultList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"resultList"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self totalPage])
    {
        [result setValue:[self totalPage] forKey:@"totalPage"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* resultListArray = [dictionary objectForKey:@"resultList"];
    if(resultListArray&&![resultListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resultListArray count];i++)
        {
        OrderResponseObject* item = [[OrderResponseObject alloc]initWithDic:[resultListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.resultList = propertyArray;
    }
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    self.totalPage = [dictionary objectForKey:@"totalPage"];
    return self;
} 

@end
  
@implementation OrderPayOrderResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
OrderPayOrderResult* result = [[OrderPayOrderResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(OrderPayOrderResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation OrderQueryOrdersResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
OrderQueryOrdersResult* result = [[OrderQueryOrdersResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(OrderQueryOrdersResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
